package it.giuseppetrisciuoglio.lyrics.persistence.repository;

import it.giuseppetrisciuoglio.lyrics.persistence.entity.Artista;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

public interface ArtistaRepository extends JpaRepository<Artista, Long> {

	@Query("select ar from Artista ar where lower(ar.nome) = :nome ")
	Artista findArtistaNome(@Param("nome")String nome);
	
	@Query("select count(ar) from Artista ar where lower(ar.nome) = :nome")
	Long countArtistaByNome(@Param("nome")String nome);
	
	Artista findByNome(String nome);

	Artista findByMbid(String mbid);
}
